package com.faner.fast.file;

import com.faner.fast.factory.YamlPropertySourceFactory;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * description: FileProperties
 * date: 2020/11/26 16:34
 * author: faner
 */
@Component
@ConfigurationProperties("fast.file")
@PropertySource(
        value = "classpath:com/faner/fast/file/extension/config.yml",
        encoding = "UTF-8", factory = YamlPropertySourceFactory.class)
@Setter
@Getter
public class FileProperties {
    private static final String[] DEFAULT_EMPTY_ARRAY = new String[0];

    private String storeDir = "/assets";

    private String singleLimit = "2MB";

    private Integer nums = 10;

    private String domain;

    private String[] exclude = DEFAULT_EMPTY_ARRAY;

    private String[] include = DEFAULT_EMPTY_ARRAY;

    /**
     * 文件存储路径
     */
    private String servePath = "assets/**";
}
